package com.qing.demo.netty.server;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;


/**
 * @author caozhipeng
 * @date 2025/7/25
 */
public class MyChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        System.out.println("链接报告开始");
        System.out.println("链接报告信息：有一个客户端链接到本地服务器");
        System.out.println("链接报告IP:"+socketChannel.localAddress().getHostString());
        System.out.println("链接报告端口:"+socketChannel.localAddress().getPort());

        socketChannel.pipeline().addLast(new MyServerHandler());
    }
}
